{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 Monaco;
}
{\colortbl;\red255\green255\blue255;\red0\green0\blue191;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs36 \cf0 Fhn2DN			FitzHughNagumo Neuron Firing Oscillator\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\fs24 \cf0 Fhn2DN.ar(minfreq, maxfreq, rateu, ratew, b0, b1, i, initu, initw, mul, add)\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 \
du/dt= rateu*(u-0.3333*u^3 - w)\
dw/dt= ratew*(b0+b1*u - w)\
\
All inputs can have .kr rate UGens plugged in.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b \cf0 minfreq, maxfreq - 
\f1\b0 freq iteration\

\f0\b rateu
\f1\b0 - update rate for u\

\f0\b ratew
\f1\b0 - update rate for w \

\f0\b b0
\f1\b0 - equation constant\

\f0\b b1
\f1\b0 - equation constant\

\f0\b i
\f1\b0  - arbitrary external impulse; i.e. pulse wave, trigger, lfnoise, or nothing.\

\f0\b initu
\f1\b0 - reset value for u\

\f0\b initw
\f1\b0 - reset value for w\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f2\fs18 \cf0 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural
\cf0 \{ \cf2 Out\cf0 .ar(0,\cf2 Pan2\cf0 .ar(0.5*\cf2 Fhn2DN\cf0 .ar(220,800,0.3,0.3,0.6,0.8,LFPulse.kr(MouseX.kr(1, 10, 1), 0, 0.1)),0.0)) \}.play\
\
(\
SynthDef(\\fhn, \{|out=0, pan=0, amp=0.1|\
	var sig;\
	sig=\cf2 Fhn2DN\cf0 .ar(110, 22050, TExpRand.kr(0.001, 0.2, Dust.kr(8)), TExpRand.kr(0.001, 0.2, Dust.kr(13)), \cf2 TRand\cf0 .kr(0.1, 0.4, Dust.kr(5)),\cf2 TRand.kr(0.1, 1.9, Dust.kr(3))\cf0 , mul:amp);\
	\cf2 Out\cf0 .ar(0,\cf2 Pan2\cf0 .ar(sig, pan))\
\}).play\
)\
\
(\
SynthDef(\\fhn, \{|out=0, pan=0, amp=0.1|\
	var sig, trig1, trig2, b0, b1;\
	trig1=FhnTrig.kr(5, 8, 0.3, 0.3, 1, 1);\
	trig2=FhnTrig.kr(8, 13, 0.27, 0.27, 0.6, 0.8);\
	b0=Fhn2DN.kr(3, 5, 0.29, 0.29, 0.5, 1.1, mul:0.23, add:0.25);\
	b1=Fhn2DN.kr(2, 3, 0.25, 0.25, 0.2, 1.5, mul:0.48, add:0.5);\
	sig=\cf2 Fhn2DN\cf0 .ar(110, 22050, TExpRand.kr(0.001, 0.3, trig1), TExpRand.kr(0.001, 0.3, trig2), \cf2 b0\cf0 , b1, mul:amp);\
	\cf2 Out\cf0 .ar(0,\cf2 Pan2\cf0 .ar(sig, pan))\
\}).play\
)}